import store from "../../store";

export default function goOnlineServer(that){
    if (!store.getters['wxh/login']) {
        that.$router.push({path: '/main/login'});
        return;
    }

    //测试环境
    let userInfo =  store.getters['wxh/userInfo'];
    let sessionId = store.getters['wxh/sessionId'];
    let userIconUrl = userInfo.vipheadphoto?userInfo.vipheadphoto:'static/image/user4.png';
    let enterpriseCode = window.api.enterpriseCode;
    let baseUrl = 'http://test.crm.scn.weilian.cn/static/custchat/index.html';
    // let baseUrl = 'http://pre.njxs.crm.scn.weilian.cn/static/custchat/index.html';
    let url = window.api.crm_customer_service_host + '?sessionId=' + sessionId+'&enterpriseId=' + userInfo.enterpriseid+'&enterpriseCode='+enterpriseCode+'&userIconUrl=' + userIconUrl;

      location.href = url;
    //  that.$router.push({path: 'online', query: {urlData: url}});
        //生产暂时跳服务中心
        // that.$router.push('server')

}